package sit.engreal.leetcode.problems300;

import sit.engreal.leetcode.util.ListNode;

/**
 * <a href="https://leetcode.cn/problems/reverse-linked-list/">206. 反转链表</a>
 */
public class LeetCode206 {
    public ListNode reverseList(ListNode head) {
        ListNode node = new ListNode();
        while (head != null) {
            node.next = new ListNode(head.val, node.next);
            head = head.next;
        }
        return node.next;
    }
}
